<?php
# ***** BEGIN LICENSE BLOCK *****
# This file is part of "myWiWall".
# Copyright (c) 2007-2008 CRP Henri Tudor and contributors.
# All rights reserved.
#
# "myWiWall" is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
# 
# "myWiWall" is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with "myWiWall"; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# ***** END LICENSE BLOCK *****
?>
<h1><?php echo ($userFormMode == 'add') ? __("User account creation") : __("User account edition"); ?></h1>
<form id="users_form" method="post" action="../../index.php/adminUsers/<?php echo $userFormMode; ?>Action">	
	<?php if ($userFormMode == 'edit'): ?>
	<input type="hidden" name="userId" value="<?php echo $userId; ?>"/>
	<?php endif; ?>
	
	<fieldset id="identifiers_section">
		<legend><?php echo __("Identifiers"); ?></legend>
		
		<div class="form_line">
			<label for="username"><?php echo __('Username'); ?> *</label>
			<input class="text" type="text" id="username" name="username" tabindex="1" maxlength="30" value="<?php if ($displayOldValues) echo $username; ?>"/>
		</div>
		<div class="form_line">
			<label for="password"><?php echo __('Password'); ?> <?php if ($userFormMode == 'add'): ?>*<?php endif; ?></label>
			<input class="text" type="password" id="password" name="password" tabindex="2"/>
		</div>
	</fieldset>
	
	<?php if (OPENID_SSO_MODE): ?>
	<fieldset>
		<legend><?php echo __("OpenID"); ?></legend>
		
		<label for="openid"><?php echo __('OpenID identifier'); ?></label>
		<input class="text" type="text" id="openid" name="openid" tabindex="4" value="<?php if ($displayOldValues) echo $openId; ?>"/>
	</fieldset>
	<?php endif; ?>
	
	<fieldset>
		<legend><?php echo __("Language"); ?></legend>
		
		<label for="language"><?php echo __('User interface language'); ?></label>
		<select id="language" name="language" tabindex="5">
			<?php foreach ($availableLanguages as $lg => $translation): ?>
			<option value="<?php echo $lg; ?>" <?php if ($displayOldValues && $lg == $language) echo 'selected="true"'; ?>><?php echo $translation; ?></option>
			<?php endforeach; ?>
		</select>
	</fieldset>
	
	<fieldset>
		<legend><?php echo __("Rights"); ?></legend>
		
		<label for="rights"><?php echo __('User type'); ?></label>
		<select id="rights" name="rights" tabindex="5">
			<?php foreach ($availableUserTypes as $strType => $value): ?>
			<option value="<?php echo $value; ?>" <?php if ($displayOldValues && $value == $userType) echo 'selected="true"'; ?>><?php echo $strType; ?></option>
			<?php endforeach; ?>
		</select>
	</fieldset>
	
	<div class="additional_info">
		<?php echo __("Fields labelled with * are mandatory.") ?>
	</div>
	
	<div class="submit">
		<input class="button" type="submit" value="<?php echo __('Save'); ?>" id="user_pref" name="user_pref" tabindex="6"/>
		<input class="button" type="reset" value="<?php echo __('Reset'); ?>" tabindex="7"/>
	</div>		
</form>